home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / sphigs / sph_mac.hqx / SRGP port to 5.0 (compressed) / SRGP_SPHIGS Root / MacSPHIGS / sph_bitstr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-14  |  554 b   |  29 lines

  1. #include "HEADERS.h"
  2. #include "sphigslocal.h"
  3.  
  4. #include "sph_bitstr.proto.h"
  5.  
  6.  
  7. void ClearBitstring (substruct_bitstring *B)
  8. {
  9.    if (*B == NULL)
  10.       *B = (unsigned char*) malloc(BYTES_PER_BITSTRING);
  11.    bzero (*B,BYTES_PER_BITSTRING);
  12. }
  13.  
  14.  
  15. /** BitstringIsClear
  16. I wish I could have made this a macro, but it wasn't possible.  Checks
  17. each byte in a bitstring to verify all bits are off.
  18. **/
  19.  
  20. boolean BitstringIsClear (substruct_bitstring B)
  21. {
  22.    register int i; 
  23.  
  24.    for (i=0; i<BYTES_PER_BITSTRING; i++)
  25.       if (B[i])
  26.      return FALSE;
  27.    return TRUE;
  28. }
  29.